package com.hs.spring_001.controller;

import com.hs.spring_001.entry.Users;
import com.hs.spring_001.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @ClassName PageController
 * @Description TODO
 */
@Controller
public class PageController {
    @Autowired
    private UserService service;

    @RequestMapping("/test")
    public String toTest(Model model){
        model.addAttribute("msg","这是提示信息");
        List<Users> users = service.fidnAll();
        model.addAttribute("userList",users);
        return "test";
    }
}
